package com.hong.collections.blocking;

import java.util.concurrent.DelayQueue;
import java.util.concurrent.Delayed;

/**
 * @Auther: Administrator
 * @Date: 2018/8/12 21:25
 * @Description:
 * 1.The delay queue will ordered by expired time?
 * 2.When poll the empty delay queue will return null? use take?
 * 3.When less the expire time will return quickly?
 * 4.Even though unexpired elements cannot e removed using{@code take} or{@code poll}
 * 5.This queue does not permit null elements.
 * 6.Use iterator can return quickly?
 *
 * NOTICE:The DelayQueue elements must implement the{@link java.util.concurrent.Delayed}
 * The DelayQueue is a unbounded queue.
 *
 */
public class DelayQueueExample {
    /**
     * private[this] def create():DelayQueue[T:<Delayed={
     * <p>
     *
     * </p>
     *
     * }]
     * @param <T>
     * @return
     */
    public static  <T extends Delayed> DelayQueue<T> create(){
        return new DelayQueue<>();
    }
}
